﻿
Option Strict On
Option Explicit On


Module modGlobalData

    'データベース接続・アクセス関連
    Public DBacs As New clsOdbcDbIf
    Public g_fDBconnect As Boolean
    Public g_iDBconnResult As Integer
    Public g_szDBIpAddress As String
    Public g_ip As String 'ADD MIAO 2019/1/1
    Public g_DBSFCommon As New clsDBSFCommon

    'ペーストDB用
    Public PasteDBacs As New clsOdbcDbIf

    '金線DB用
    Public WireDBacs As New clsOdbcDbIf

    'insitetestDB用
    Public itinfraDBacs As New clsOdbcDbIf

    'レジンDB用
    Public ResinDBacs As New clsOdbcDbIf

    '拠点モード
    Public Const ATLAS_STANDARD As Integer = 0         '標準
    Public Const ATLAS_YONEZAWA As Integer = 1         '米沢
    Public Const ATLAS_HAKODATE As Integer = 2         '函館
    Public Const ATLAS_RSB As Integer = 3              'RSB追加 20111227
    Public Const ATLAS_RSC As Integer = 4              'RSC追加 20130509
    Public Const ATLAS_RSM As Integer = 5              'RSM追加 20130712
    Public Const ATLAS_TEST As Integer = 90            '北伊丹TEST用 20121207 元は10 20121211

    '言語設定
    Public g_NlsLanguage As String
    Public Const LANG_JAPANESE As String = "ja-JP"
    Public Const LANG_CHINESE As String = "zh-CN"

    '共通変数
    Public g_szInitFileName As String
    Public htMsgMst As New Hashtable                'Add 2018/02/19 frmStartCompleteBaseから移動 エラーメッセージ保持用

    '>> 2018/02/20 安部 iniファイル整理
    Public Const PARAM_TIMERINT As Integer = 9990
    Public Const PARAM_TIMEOUT As Integer = 9991
    Public Const PARAM_PORTNAME As Integer = 9992
    Public Const PARAM_ICTAGUSED As Integer = 9993
    Public Const PARAM_LANG As Integer = 9995
    Public Const PARAM_IMAGEPATH As Integer = 9996
    Public Const PARAM_PASSWORD As Integer = 9997

    Public Const PARAM_TIMERINT_DEFAULT As Integer = 1
    Public Const PARAM_TIMEOUT_DEFAULT As Integer = 60
    Public Const PARAM_PORTNAME_DEFAULT As String = "COM11"
    Public Const PARAM_ICTAGUSED_DEFAULT As String = "False"
    Public Const PARAM_LANG_DEFAULT As String = "J"
    Public Const PARAM_IMAGEPATH_DEFAULT As String = "C:\Image\"
    Public Const PARAM_PASSWORD_DEFAULT As String = "0"


    Public m_fIcTagUsed As Boolean
    Public m_szPortName As String
    '<< 2018/02/20 安部 iniファイル整理


    '検査数量タイプ追加
    Public g_inspection_qty_type As Integer         'Add 2018/02/19 検査数量タイプ追加

    Public Structure ServerDBacsTYPE
        Dim szDrive As String
        Dim szIPadr As String
        Dim szDsn As String
        Dim szDbn As String
        Dim szUid As String
        Dim szPas As String
        Dim iOver As Integer
        Dim iPORT As Integer 'ADD MIAO 2018/10/19
    End Structure
    Public g_Server As ServerDBacsTYPE
    Public paste_Server As ServerDBacsTYPE
    Public wire_Server As ServerDBacsTYPE
    Public itinfra_Server As ServerDBacsTYPE
    Public resin_Server As ServerDBacsTYPE

    Public g_szFactoryName As String
    Public g_iFactoryMode As Integer
    Public g_szClientVersion As String
    Public g_szApliVersion As String
    '>> 2018/02/20 安部 iniファイル整理
    'Public g_iMpcNo As Integer
    '<< 2018/02/20 安部 iniファイル整理

    '時刻
    Public DEFAULT_DATE As Date = CDate("2001-01-01 00:00:00")

    '装置選択関連
    Public g_iLayoutNo As Integer
    Public g_iLayoutName As String

    Public g_fSelectEquipEnd As Boolean
    Public g_fSelectLotEnd As Boolean

    ' 装置タイプID
    Public Const DEF_ID_DB As Long = 1
    Public Const DEF_ID_FW As Long = 2
    Public Const DEF_ID_WB As Long = 3
    Public Const DEF_ID_QC As Long = 49999              '2017/10/14＠蘇州
    Public Const DEF_ID_INSP As Long = 4                '2017/10/14＠蘇州
    Public Const DEF_ID_MOLD As Long = 6
    Public Const DEF_ID_TRA As Long = 7
    Public Const DEF_ID_LTF As Long = 89999             '2017/10/14＠蘇州
    Public Const DEF_ID_FT_HANDLER As Long = 99999      '2017/10/14＠蘇州
    Public Const DEF_ID_FT_BARIN As Long = 10
    Public Const DEF_ID_FT_GAIKAN As Long = 5           '2017/10/14＠蘇州
    Public Const DEF_ID_FT_SOUBATSU As Long = 12
    Public Const DEF_ID_MOLD_AFC As Long = 13 '31       '2017/10/14＠蘇州'UPD 苗 2018/1/26 
    Public Const DEF_ID_FT_TESTER As Long = 9           '2017/10/14＠蘇州
    Public Const DEF_ID_PIXTUKA As Long = 15
    Public Const DEF_ID_BALL As Long = 16
    Public Const DEF_ID_PLASMA As Long = 17
    Public Const DEF_ID_EA_TESTER As Long = 19          '2017/10/14＠蘇州
    Public Const DEF_ID_EA_HANDLER As Long = 199999     '2017/10/14＠蘇州
    Public Const DEF_ID_SENBETSU_TESTER As Long = 20
    Public Const DEF_ID_SENBETSU_HANDLER As Long = 21
    Public Const DEF_ID_DIESER As Long = 22
    Public Const DEF_ID_MBTC As Long = 239999           '2017/10/14＠蘇州
    Public Const DEF_ID_MARK As Long = 24
    Public Const DEF_ID_HS As Long = 25
    Public Const DEF_ID_BARINUKI As Long = 26
    Public Const DEF_ID_BCW As Long = 27
    Public Const DEF_ID_DBAFC As Long = 28 '70  '2017/10/14＠蘇州 'UPD 苗 2018/1/19 
    Public Const DEF_ID_MEKIAFC As Long = 77 　　　　　　 'ADD 苗 2018/1/25
    Public Const DEF_ID_WBLINK As Long = 29
    Public Const DEF_ID_WVI As Long = 30
    Public Const DEF_ID_BAKE As Long = 319999           '2017/10/14＠蘇州
    Public Const DEF_ID_FCDB As Long = 32
    Public Const DEF_ID_FCUF As Long = 33
    Public Const DEF_ID_FCHS As Long = 34
    Public Const DEF_ID_FCBL As Long = 35
    Public Const DEF_ID_TCLM As Long = 36
    Public Const DEF_ID_KOHEN_DIESER_LINK As Long = 37
    Public Const DEF_ID_PLATE As Long = 38
    Public Const DEF_ID_WASH As Long = 39
    Public Const DEF_ID_MOUNTER As Long = 40
    Public Const DEF_ID_FRAME_MOUNTER As Long = 41
    Public Const DEF_ID_KOHEN_DIESER As Long = 42
    Public Const DEF_ID_WBQC As Long = 43
    Public Const DEF_ID_MOLDQC As Long = 44
    Public Const DEF_ID_FCBGAAFC As Long = 45
    Public Const DEF_ID_WAFER As Long = 46
    Public Const DEF_ID_PARTICLE As Long = 47
    Public Const DEF_ID_XSEN As Long = 48
    Public Const DEF_ID_CHECK As Long = 49
    Public Const DEF_ID_HAKO As Long = 50
    Public Const DEF_ID_PQC As Long = 51
    Public Const DEF_ID_PUSH As Long = 52
    Public Const DEF_ID_PULL As Long = 52           '2017/10/14＠蘇州
    Public Const DEF_ID_P_CHECK As Long = 54
  
' 2017/07/18 Mod Start m-abe 兪さんの修正をマージ
'    Public Const DATA_LENGTH As Integer = LOT_KIND_BEGIN + STATUS_LENGTH
'    Public Const DEF_ID_TAPE As Long = 55
    Public Const DEF_ID_TAPE As Long = 46
' 2017/07/18 Mod Wnd   m-abe 兪さんの修正をマージ
    Public Const DEF_ID_TAPE_UV As Long = 56
    Public Const DEF_ID_DIC_CHK As Long = 57
    Public Const DEF_ID_TAPING As Long = 59
    Public Const DEF_ID_SHEET As Long = 60
    Public Const DEF_ID_BIST As Long = 61
    Public Const DEF_ID_ERASE As Long = 62
    Public Const DEF_ID_E_PUSH As Long = 63
    Public Const DEF_ID_E_PULL As Long = 64
    Public Const DEF_ID_BIST_BK As Long = 65
    Public Const DEF_ID_BARCODE As Long = 66
    Public Const DEF_ID_HS_BAKE As Long = 67
    Public Const DEF_ID_HS_PLASMA As Long = 68
    Public Const DEF_ID_M_DICER As Long = 69
    Public Const DEF_ID_PBAKE As Long = 70
    Public Const DEF_ID_TEMPCYCLE As Long = 71
    Public Const DEF_ID_MARKX As Long = 72
    Public Const DEF_ID_MAEPRO As Long = 73
    Public Const DEF_ID_REFLOW As Long = 74
    Public Const DEF_ID_TRAVEL As Long = 75
    Public Const DEF_ID_GAIBAKE As Long = 76
    'Public Const DEF_ID_PBAKE As Long = 77
    Public Const DEF_ID_WATERJET As Long = 78
    Public Const DEF_ID_AUTOX As Long = 79
    Public Const DEF_ID_LASER_DICING As Long = 81
    Public Const DEF_ID_DAM_CUT As Long = 23        '2017/10/14＠蘇州
    Public Const DEF_ID_CUT As Long = 8             '2017/10/14＠蘇州
    Public Const DEF_ID_A_CUT_VIEW As Long = 86     '2017/10/14＠蘇州
    Public Const DEF_ID_PLATING_BAKE As Long = 77   '2017/10/14＠蘇州
    Public Const DEF_ID_VISUAL_VIEW As Long = 11
    Public Const DEF_ID_CHECKWORK As Long = 49      '2017/10/14＠蘇州
    Public Const DEF_ID_TAPING_BEFORE As Long = 89  '2017/10/14＠蘇州
    Public Const DEF_ID_PACKING As Long = 50        '2017/10/14＠蘇州
    Public Const DEF_ID_TAPING_VIEW As Long = 83    '2017/10/14＠蘇州
    Public Const DEF_ID_TEST_ABNORMAL As Long = 87  '2017/10/14＠蘇州
    Public Const DEF_ID_DUMMY As Long = 88          '2017/10/14＠蘇州
    Public Const DEF_ID_PLTGAIKAN As Long = 95      '2018/01/14＠北京 苗 2018/1/14
    Public Const DEF_ID_ETC As Long = 99

    '工程CD
    Public Const PROC_CD_DBS As String = "S41"
    Public Const PROC_CD_DBA As String = "A41"
    Public Const PROC_CD_WBS As String = "S42"
    Public Const PROC_CD_WBA As String = "A42"
    Public Const PROC_CD_MOLDS As String = "S51"
    Public Const PROC_CD_MOLDA As String = "A51"
    Public Const PROC_CD_MARK As String = "A54"
    Public Const PROC_CD_TC As String = "A10"


    Public Const PROC_CD_TRA As String = ""
    Public Const PROC_CD_LTF As String = ""
    Public Const PROC_CD_FT_HANDLER As String = ""
    Public Const PROC_CD_FT_BARIN As String = "M200"
    Public Const PROC_CD_FT_GAIKAN1 As String = "P300"
    Public Const PROC_CD_FT_GAIKAN2 As String = "P340"
    Public Const PROC_CD_FT_GAIKAN_FINAL As String = "P320"
    Public Const PROC_CD_FT_SOUBATSU As String = ""
    Public Const PROC_CD_MOLD_AFC As String = "E200"
    Public Const PROC_CD_FT_TEST0 As String = "M050"
    Public Const PROC_CD_FT_TEST1 As String = "N200"
    Public Const PROC_CD_FT_TEST2 As String = "N300"
    Public Const PROC_CD_FT_TEST3 As String = "N400"
    Public Const PROC_CD_PIXTUKA As String = "L550"
    Public Const PROC_CD_BALL As String = "I450"
    Public Const PROC_CD_PC1 As String = "D300"
    Public Const PROC_CD_PC2 As String = "D600"
    Public Const PROC_CD_PLASMA_WB As String = "4280"
    Public Const PROC_CD_PLASMA_MD As String = "E050"
    Public Const PROC_CD_EA_TESTER As String = "M450"
    Public Const PROC_CD_EA_HANDLER As String = ""
    Public Const PROC_CD_SENBETSU_TESTER As String = ""
    Public Const PROC_CD_SENBETSU_HANDLER As String = ""
    Public Const PROC_CD_DIESER As String = "C300"
    Public Const PROC_CD_MBTC As String = ""
    'Public Const PROC_CD_MARK As String = "I300"
    Public Const PROC_CD_HS As String = "L320"
    Public Const PROC_CD_BARINUKI As String = "E800"
    Public Const PROC_CD_BCW As String = ""
    Public Const PROC_CD_DBAFC As String = "D200"
    Public Const PROC_CD_WBLINK As String = ""
    Public Const PROC_CD_WVI As String = ""
    Public Const PROC_CD_BAKE As String = ""
    Public Const PROC_CD_FCDB As String = ""
    Public Const PROC_CD_FCUF As String = ""
    Public Const PROC_CD_FCHS As String = ""
    Public Const PROC_CD_FCBL As String = "I450"
    Public Const PROC_CD_TCLM As String = ""
    Public Const PROC_CD_KOHEN_DIESER_LINK As String = "L200"
    Public Const PROC_CD_PLATE As String = ""
    Public Const PROC_CD_WASH As String = "I600"
    Public Const PROC_CD_MOUNTER As String = ""
    Public Const PROC_CD_FRAME_MOUNTER As String = ""
    Public Const PROC_CD_KOHEN_DIESER As String = "L200"
    Public Const PROC_CD_WBQC As String = ""
    Public Const PROC_CD_MOLDQC As String = "E260"
    Public Const PROC_CD_FCBGAAFC As String = ""
    Public Const PROC_CD_WAFER As String = ""
    Public Const PROC_CD_PARTICLE As String = ""
    Public Const PROC_CD_XSEN As String = "E400"
    Public Const PROC_CD_CHECK As String = ""
    Public Const PROC_CD_HAKO As String = "Q100"
    Public Const PROC_CD_PQC As String = ""
    Public Const PROC_CD_PUSH As String = "M100"
    Public Const PROC_CD_PULL As String = "M500"
    Public Const PROC_CD_P_CHECK As String = ""
    Public Const PROC_CD_TAPE As String = "C200"
    Public Const PROC_CD_BARCODE As String = "C220"
    Public Const PROC_CD_TAPE_UV As String = "C400"
    Public Const PROC_CD_DIC_CHK As String = "C600"
    Public Const PROC_CD_TAPING As String = "P950"
    Public Const PROC_CD_SHEET As String = "L100"
    Public Const PROC_CD_REPAIR As String = "M280"
    Public Const PROC_CD_BIST As String = "M300"
    Public Const PROC_CD_ERASE As String = "M820"
    Public Const PROC_CD_E_PUSH As String = "M800"
    Public Const PROC_CD_E_PULL As String = "M840"
    Public Const PROC_CD_BIST_BK As String = "M700"
    Public Const PROC_CD_HS_BAKE As String = "L340"
    Public Const PROC_CD_HS_PLASMA As String = "L050"
    Public Const PROC_CD_M_DICER As String = "L200"
    Public Const PROC_CD_MARK2 As String = "L420"
    Public Const PROC_CD_MAECUT As String = "E500"
    Public Const PROC_CD_DAM As String = "E520"
    Public Const PROC_CD_HSCUT As String = "E540"
    Public Const PROC_CD_TEMPCYCLE As String = "E300"
    Public Const PROC_CD_MARKX1 As String = "I999"
    Public Const PROC_CD_MARKX2 As String = "L001"
    Public Const PROC_CD_MARKX3 As String = "L070"
    Public Const PROC_CD_GBAKE1 As String = "N200"
    Public Const PROC_CD_GBAKE2 As String = "L999"
    Public Const PROC_CD_GBAKE3 As String = "P050"
    Public Const PROC_CD_GBAKE4 As String = "P120"
    Public Const PROC_CD_GBAKE5 As String = "P520"
    Public Const PROC_CD_WATERJET As String = "I110"
    Public Const PROC_CD_AUTOX As String = "E410"
    Public Const PROC_CD_PLATE1 As String = "E999"
    Public Const PROC_CD_PLATE2 As String = "I200"
    Public Const PROC_CD_ETC As String = ""

    'ロット関連
    Public NG_CATEGORY_MAX As Integer = 50

    'レシピエラーコード
    Public Const RCP_File_OK As String = "OK"
    Public Const RCP_ERR_E_ID As String = "NG"
    Public Const RCP_ERR_E_M_TOUT As String = "E1"
    Public Const RCP_ERR_M_S_TOUT As String = "S1"
    Public Const RCP_ERR_S_M_TOUT As String = "M1"
    Public Const RCP_ERR_E_DENY As String = "E2"
    Public Const RCP_ERR_NO_ID As String = "M3"
    Public Const RCP_ERR_NO_SPT As String = "M4"
    Public Const RCP_ERR_NO_MPC As String = "M5"
    Public Const RCP_ERR_F_ZERO As String = "F1"
    Public Const RCP_ERR_F_DATA As String = "F2"
    Public Const RCP_ERR_RCP As String = "I1"
    Public Const RCP_ERR_RCP_TOUT As String = "I2"
    Public Const RCP_ERR_E_HIT As String = "I3"
    Public Const RCP_ERR_HIT_TOUT As String = "I4"
    Public Const RCP_ERR_NO_NIT As String = "I5"
    Public Const RCP_ERR_F_TOUT0 As String = "I6"
    Public Const RCP_ERR_F_TOUT1 As String = "I7"
    Public Const RCP_ERR_RCP_FILE As String = "I8"
    Public Const RCP_ERR_RCP_WR As String = "I9"
    Public Const RCP_ERR_RCP_TRN0 As String = "IA"
    Public Const RCP_ERR_RCP_RECV As String = "IB"
    Public Const RCP_ERR_IDLE As String = "IC"
    Public Const RCP_ERR_IDLE_TOUT As String = "ID"
    Public Const RCP_ERR_RCP_TRN1 As String = "IE"
    Public Const RCP_ERR_RCP_DENY As String = "IF"
    Public Const RCP_ERR_FILE_TOUT As String = "IG"
    Public Const RCP_ERR_FILE_RECV As String = "IH"
    Public Const RCP_ERR_RECV_TOUT As String = "II"

    'マスタバックアップ
    Public Const MASTER_MARK As String = "MASTER"
    Public Const MASTER_BKP As String = "MASTER_BKP"

    Public Const OK As String = "OK"
    Public Const NG As String = "NG"
    Public Const WA As String = "WA"

    Public Const COMMAND_OK As String = "000" 'ADD MIAO 2019/10/1
    Public Const COMMAND_NG As String = "001" 'ADD MIAO 2019/10/1


    'レシピ照合表示
    Public Const DISP_NO = 0
    Public Const DISP_PARA_NAME = 1
    Public Const DISP_UNIT = 2
    Public Const DISP_PARA_TYPE = 3
    Public Const DISP_PARA_MIN = 4
    Public Const DISP_PARA_MAX = 5
    Public Const DISP_PARA_MODE = 6
    Public Const DISP_REV_NO = 7
    Public Const DISP_PARA_NO = 8

    Public ReadOnly RCP_HEADER() As String = {"NO", "Parameter", "Unit", "Type", "Min", "Max", "Mode", "Rev No", "PARA_NO"}

    'レシピ照合結果
    Public Const RCP_PARAM As Integer = 0
    Public Const RCP_DAT As Integer = 1
    Public Const RCP_RCP_NO As Integer = 2
    Public Const RCP_RCP_REV As Integer = 3
    Public Const RCP_UNIT As Integer = 4
    Public Const RCP_TYPE As Integer = 5
    Public Const RCP_MIN As Integer = 6
    Public Const RCP_MAX As Integer = 7
    Public Const RCP_MODE As Integer = 8
    Public Const RCP_RESULT As Integer = 9

    '着工完了
    Public g_CURRENT_EQUIP_ID As String = ""
    Public g_CURRENT_EQUIP_TYPE As Integer = 0
    Public g_EQUIP_NO As String = ""
    Public g_LOT_NO As String = ""

    '>> 2018/02/20 安部 iniファイル整理
    'Public g_IS_PROD As Integer = 0
    Public m_szLang As String = "" ' frmStartCompleteBaseからmodGlobalData へ移動
    Public m_szImagePath As String = ""
    '<< 2018/02/20 安部 iniファイル整理


    'ICタグユーザーメモリ定義
    Public Const INT_LENGTH As Integer = 2
    Public Const STATUS_LENGTH As Integer = 1
    Public Const FLAG_LENGTH As Integer = 1
    Public Const LOT_NO_BEGIN As Integer = 12
    Public Const LOT_NO_LENGTH As Integer = 20
    Public Const DIF_LOT_BEGIN As Integer = LOT_NO_BEGIN + LOT_NO_LENGTH
    Public Const DIF_LOT_LENGTH As Integer = 20
    Public Const STATUS_BEGIN As Integer = DIF_LOT_BEGIN + DIF_LOT_LENGTH
    Public Const EQUIP_NO_BEGIN As Integer = STATUS_BEGIN + STATUS_LENGTH
    Public Const EQUIP_NO_LENGTH As Integer = 16
    Public Const PROCS_CD_BEGIN As Integer = EQUIP_NO_BEGIN + EQUIP_NO_LENGTH
    Public Const PROCS_CD_LENGTH As Integer = 10
    Public Const INPUT_BEGIN As Integer = PROCS_CD_BEGIN + PROCS_CD_LENGTH
    Public Const FINISH_BEGIN As Integer = INPUT_BEGIN + INT_LENGTH
    Public Const FAILED_BEGIN As Integer = FINISH_BEGIN + INT_LENGTH
    Public Const FRAME_BEGIN As Integer = FAILED_BEGIN + INT_LENGTH
    Public Const CROSS_BEGIN As Integer = FRAME_BEGIN + INT_LENGTH
    Public Const Q_FLAG_BEGIN As Integer = CROSS_BEGIN + INT_LENGTH
    Public Const TEST_FLAG_BEGIN As Integer = Q_FLAG_BEGIN + FLAG_LENGTH
    Public Const CHECK_FLAG_BEGIN As Integer = TEST_FLAG_BEGIN + FLAG_LENGTH
    Public Const HOLD_FLAG_BEGIN As Integer = CHECK_FLAG_BEGIN + FLAG_LENGTH

    Public Const LOT_KIND_BEGIN As Integer = FRAME_BEGIN + INT_LENGTH
' 2017/07/18 Mod Start m-abe 兪さんの修正をマージ
'    Public Const DATA_LENGTH As Integer = LOT_KIND_BEGIN + STATUS_LENGTH
'
    Public Const DATA_LENGTH As Integer = 2 + STATUS_LENGTH
' 2017/07/18 Mod End m-abe  兪さんの修正をマージ
    Public Const ACK_CNT_LENGTH As Integer = 9
    Public Const ACK_UID_LENGTH As Integer = 16
    Public Const TAG_COUNT As Integer = 2

    Public Const EXEC_PG_TAG_CHNG_MTRL As String = "CHNG_MTRL"                      ' 品種切替用のTAG ADD 苗 2018/1/27
    Public Const COMMON_PROC_CD As String = "COMMON"                                ' 共通用の工程CD(外部EXE用）苗 2018/1/27
    Public Const EXEC_PG_TAG_NBIGS As String = "NBIGS"                      　　　　' NBIGS用のTAG ADD 苗 2018/2/27
    Public Const EXEC_EVENT As String = "EVENT"                                     ' atlasの稼働検視画面 2019/1/7

    Public g_szSelectedTime As String = String.Empty

    'ICタグ通信
' 2017/07/18 Mod Start m-abe 兪さんの修正をマージ
    'Public g_cRFID As clsRfidTag
    Public g_cRFID As clsRfidTag
' 2017/07/18 Mod End m-abe  兪さんの修正をマージ
    Public WithEvents g_SerialPort As System.IO.Ports.SerialPort
    Public g_SerialArg As IO.Ports.SerialDataReceivedEventArgs
    Public g_fDataOK As Boolean = False
    Public g_fDataSet As Boolean = False
    Public g_fRespOK As Boolean = False
    Public g_fNACK As Boolean = False
    Public g_fNoTagResp As Boolean = False

    Public g_ETKitMangeMix_WCF_WIN As String = "ETKitMangeMix_WCF_WIN" 'ADD 2018/4/2 苗

    'MPC-Net（レシピ照合）通信モード
    Public m_EquipInterface As String
    Public m_EquipInstPattern As String
    Public m_EquipInstMode As String
    Public m_EquipProgTrans As String
    Public m_EquipCompProc As String
    Public m_EquipIPAddress As String
    Public m_EquipPort As String
    Public m_WARNING As String = "1"

    ''通信数
    'Public g_iMSCPsendAllCnt As Integer
    'Public g_iMSCPrecvAllCnt As Integer
    'Public g_iHSMSsendAllCnt As Integer
    'Public g_iHSMSrecvAllCnt As Integer

    ''装置最大コネクト数
    'Public g_HsmsCommMax As Integer

    ''通信送受信フラグ
    'Public g_iServerCommStart As Integer
    'Public g_iEquipCommStart As Integer

    'Public g_fHSMSdetailFlg As Boolean

    'Public g_iHsmsCommTestStart As Integer
    'Public g_iHsmsCommTestResult As Integer
    'Public g_iHsmsCommTestWait As Integer

    ''HSMS登録情報
    'Public g_iLocalPortNo As Integer
    'Public g_fIPcheckFlg As Boolean
    'Public g_HsmsRetryCommWait As Integer

    ''Equip登録情報(Activ情報)
    'Public g_iEquipPortNo As Integer
    'Public g_szEquipIPaddr() As String

    'Public Structure HsmsActivInfoTYPE
    '    Dim szIPaddr As String      '接続先アドレス
    '    Dim iPortNo As Integer
    '    Dim iSeq As Integer
    'End Structure
    'Public g_HsmsActivInfo() As HsmsActivInfoTYPE

    ''HSMS受信フラグ
    'Public Structure HsmsInfoTYPE
    '    Dim szIPaddr As String      '接続先アドレス
    '    Dim iIPaddr() As Integer
    '    Dim iPortNo As Integer
    '    Dim dteOpenDate As Date
    '    Dim iConnMode As Integer

    '    Dim iConnect As Integer        '0:NoConnect 1:Connect
    '    Dim dteRecvDate As Date
    '    Dim dteSendDate As Date
    '    Dim iRecvCnt As Integer
    '    Dim iSendCnt As Integer

    '    Dim iDevID As Integer
    '    Dim uiSysSendByte As UInteger
    '    Dim uiSystemByte As UInteger
    '    Dim uiSystemByteS14F1 As UInteger
    '    Dim iComNo As Integer
    '    Dim iCID As Integer
    '    Dim iEquipType As Integer       '0:K&S  1:UTC
    '    Dim szEquipID As String
    '    Dim szEquipNo As String

    '    'Splitter対応
    '    Dim iActComNo As Integer
    '    Dim iActCID As Integer
    '    Dim iActIPaddr() As Integer
    '    Dim szActIPaddr As String
    '    Dim iActIPUse As Integer

    '    Dim szRecvEquipID As String
    '    Dim szRecvKouteiCode As String

    '    Dim iChipCnt As Integer
    '    Dim iWireChipCnt As Integer
    '    Dim dWireRemain As Single
    '    Dim fProdStat As Boolean
    '    Dim fErrorStat As Boolean

    '    Dim iRcpNameSeq As Integer
    '    Dim iRcpNameGetStart As Integer
    '    Dim iRcpAllNameSeq As Integer
    '    Dim iRcpAllNameGetStart As Integer
    '    Dim iRcpDataSeq As Integer
    '    Dim iRcpDataGetStart As Integer
    '    Dim iRcpDataSize As Integer
    '    Dim iRcpResult As Integer
    '    Dim szRcpJuge As String

    '    Dim szRcpEquipID As String
    '    Dim szRcpRecvName As String
    '    Dim szRcpSendName As String
    '    Dim iRcpOverTime As Integer
    '    Dim dteRcpStartDate As Date

    '    Dim dRcpUsgFreq As Single
    '    Dim dRcpUsgImpi As Single
    '    Dim lRcpTemperature() As Long
    '    Dim lRcpTempOffset() As Long
    '    Dim iRcpValueSeq As Integer
    '    Dim iRcpValueGetStart As Integer

    '    'Ver304 Recipe Name Change
    '    Dim iRcpChgTestMode As Integer
    '    Dim iRcpAllNameCnt As Integer
    '    Dim szRcpAllName() As String
    '    Dim iRcpChangeSeq As Integer
    '    Dim iRcpChangeStart As Integer
    '    Dim szSelectRcpName As String
    '    Dim iDispMessSeq As Integer
    '    Dim iDispMessStart As Integer
    '    Dim iSelectRcpNo As Integer
    '    'Gen-CT対応追加
    '    Dim iRcpChgMode As Integer                  ' プログラム切替モード　0:無/1：有
    '    Dim iILRequest As Integer                   ' インタロック指示　0:無/1:ON/2：OFF

    '    Dim iActivSeq As Integer
    '    Dim iInitSeq As Integer
    '    Dim iCloseSeq As Integer
    '    'ver4.4.7
    '    Dim iSpcCheckSeq As Integer
    '    Dim iSpcCheckStart As Integer

    '    Dim fSelectRecv As Boolean
    '    'Ver304 Select wait
    '    Dim fSelectSend As Boolean
    '    Dim fS1F2 As Boolean
    '    Dim fS1F4 As Boolean
    '    Dim fS1F13 As Boolean
    '    Dim fS1F14 As Boolean
    '    Dim fS2F14 As Boolean
    '    Dim fS2F42_REM As Boolean
    '    Dim fS2F42_OSTR As Boolean
    '    Dim fS2F34 As Boolean
    '    Dim fS2F36 As Boolean
    '    Dim fS2F38 As Boolean
    '    Dim fS2F42 As Boolean
    '    Dim fS5F4 As Boolean
    '    Dim fS7F2 As Boolean
    '    Dim fS7F6 As Boolean
    '    Dim fS7F20 As Boolean
    '    Dim fS6F11_8020 As Boolean
    '    Dim fS6F11_8101 As Boolean
    '    Dim fS6F11_8102 As Boolean
    '    Dim szS2F41Mode As String
    '    Dim szS1F3Mode As String
    '    'Ver304 Recipe Name Change
    '    Dim fS10F6 As Boolean
    '    Dim fS5F0 As Boolean
    '    Dim fS2F0 As Boolean
    '    'Gen-CT対応追加
    '    Dim szS6F11_PRG As String               'カレントプログラム名報告
    '    Dim fS6F11_RMT As Boolean               'ONLINE-REMOTE状態確認
    '    'Ver4.1.7
    '    Dim bTOWA_Lock As Boolean               'Lock check
    '    'Ver4.2.1
    '    Dim iS1F3_CtrlState As Integer          '現在ステータス
    '    'Ver4.3.0
    '    Dim fS1F0 As Boolean
    '    'Ver4.4.4 Add
    '    Dim bSVID_Ctrl As Boolean               'Control Status
    '    'ver4.4.7
    '    Dim fS7F26 As Boolean

    '    Dim iHACK As Integer                    '現行はS2F42のHACK専用　他共用する場合は注意！！
    '    Dim iPPGNT As Integer

    '    'UTC
    '    Dim fUTCinitStart As Boolean

    '    'ﾌﾚｰﾑID
    '    Dim szFrameID As String
    '    Dim szFrameMap As String
    '    Dim iFrameX As Integer
    '    Dim iFrameY As Integer
    '    Dim iMapSize As Integer
    '    Dim szFAresult As String
    '    Dim szKouteiCode As String
    '    Dim szLotNo As String
    '    Dim iLocation As Integer
    '    Dim szFrGetEquipID As String     'ﾌﾚｰﾑID/Map要求時 装置ID
    '    Dim iFrGetMode As Integer        'ﾌﾚｰﾑID/Map要求時 0:IDのみ　1:全て

    '    'ｲﾝﾀｰﾛｯｸ
    '    Dim szILequipID As String
    '    Dim szILmode As String
    '    Dim iInterLockSeq As Integer
    '    Dim iInterLockStart As Integer
    '    Dim dteILstartDate As Date
    '    Dim szILjuge As String
    '    Dim lILwaitTime As Long

    '    'Gen-CT対応追加
    '    Dim iILreqHost As Integer               ' インタロック指示元　0：Server/1：GenCT

    '    Dim iGenCTintNo As Integer              ' GenCT通信スレッドNo
    '    Dim iGenCTCotrlStatus As Integer        ' GetCT通信ステータス 0：OK/他：エラー
    '    Dim szGenCTControlResult As String      ' GenCT状態報告 0:インタロックON/1：インタロックOFF/2：不定/9：Busy
    '    Dim iGenCTCommStart As Integer          ' Gen-CT通信
    '    Dim iGenCTCommSeq As Integer            ' Gen-CT通信シーケンス
    '    'Ver4.1.5 インタロックステータス追加
    '    Dim iGenCTILStatus As Integer           ' インタロック状態　0:OFF/1:ON/2:不定

    '    Dim iOnlineRemoteSeq As Integer         'Online-Remoteへの切替シーケンス
    '    Dim iOnlineRemoteStart As Integer       'Online-Remote要求フラグ

    '    Public Sub Initialize()
    '        ReDim iIPaddr(4)
    '        ReDim lRcpTemperature(3)
    '        ReDim lRcpTempOffset(3)
    '        ReDim iActIPaddr(4)
    '    End Sub

    'End Structure
    'Public g_HsmsInfo() As HsmsInfoTYPE

    ''●FCマウンタ(芝浦）関連
    'Public Structure m_FCMInfoTYPE
    '    Dim szTopWaferPupDate As String     '520 Actual time stamp(Time of top wafer pickup)
    '    Dim szBondingDate As String         '522 Actual time stamp(Time of bonding)
    '    Dim szPPID As String                '523 PPID(RecipeName)
    '    Dim iTWPupX As Integer              '530 Top wafer picked up index X(IC side)
    '    Dim iTWPupY As Integer              '531 Top wafer picked up index Y(IC side)
    '    Dim iTWpupBDX As Integer            '532 Top wafer picked up index X(IC side) (Bonding side)
    '    Dim iTWpupBDY As Integer            '533 Top wafer picked up index Y(IC side) (Bonding side)
    '    Dim iKposX As Integer               '534 Substrate index X(Bonding side)
    '    Dim iKposY As Integer               '535 Substrate index Y(Bonding side)
    '    Dim iTWrecX As Integer              '600 Top wafer first chip recognition index X(IC side)
    '    Dim iTWrecY As Integer              '601 Top wafer first chip recognition index Y(IC side)
    '    Dim dTWrecRatio As Double           '602 Top wafer first chip recognition matching ratio(IC side)
    '    Dim dTWpupPosX As Double            '603 Top wafer picked up actual coordinate X
    '    Dim dTWpupPosY As Double            '604 Top wafer picked up actual coordinate Y
    '    Dim dTWPuprecRatio1 As Double       '605 Top wafer picked up recognition matching ratio(IC side) 1st position
    '    Dim dTWPuprecRatio2 As Double       '606 Top wafer picked up recognition matching ratio(IC side) 2nd position
    '    'Dim dActDipLevel As Double          '700 Actual dipping level
    '    'Dim dSetDipForce As Double          '701 Setting dipping force
    '    'Dim dActDipForce As Double          '702 Actual dipping force
    '    'Dim dSetDipTime As Double           '703 Setting dipping time
    '    'Dim szDippingDate As String         '705 Actual time stamp(Time of dipping)
    '    Dim dActBondLevel As Double         '800 Actual bonding level
    '    Dim dSetBondForce As Double         '801 Setting bonding force
    '    Dim dActBondForce As Double         '802 Actual bonding force
    '    Dim dSetBondTime As Double          '803 Setting bonding time
    '    Dim dKrecRatio1 As Double           '804 Substrate recognition matching ratio 1st position
    '    Dim dKrecRatio2 As Double           '805 Substrate recognition matching ratio 2nd position
    '    Dim dKmarkDist As Double            '806 Substrate recognition mark distance
    '    Dim dICrecRario1 As Double          '807 IC recognition matching ratio 1st position
    '    Dim dICrecRario2 As Double          '808 IC recognition matching ratio 2nd position
    '    Dim dICmarkDist As Double           '809 IC recognition mark distance
    'End Structure
    'Public g_FCMInfo() As m_FCMInfoTYPE

    'Public g_iFCMTWrecX As Integer          '600 Top wafer first chip recognition index X(IC side)
    'Public g_iFCMTWrecY As Integer          '601 Top wafer first chip recognition index Y(IC side)
    'Public g_dFCMTWrecRatio As Double       '602 Top wafer first chip recognition matching ratio(IC side)

    'Public g_FCMreportMax As Integer = 1    'FCマウンタ  最大報告配列数
    'Public g_iFCMPupCnt As Integer
    'Public g_iFCMBndCnt As Integer

    ''●Gen-CT通信関連
    'Public g_fGenCTUseFlg As Boolean        'GenCT　True：有効/False：無効
    'Public g_iGenCTPort As Integer          'GenCT　接続ポート
    'Public g_GenCTCommMax As Integer = 50   'GenCT  最大接続数
    ''Gen-CT回答定義
    'Public Const GENCT_SET_OK As String = "0"           ' 正常終了
    'Public Const GENCT_TIME_OUT As String = "10"        ' Gen-CTタイムアウト
    'Public Const GENCT_HW_ERROR As String = "11"        ' H/Wエラー(USB-IO異常)
    'Public Const GENCT_MC_MOVE As String = "12"         ' 装置動作中
    'Public Const GENCT_FORMAT_ERROR As String = "13"    ' フォーマット異常
    'Public Const GENCT_NO_EQUIP_ID As String = "14"     ' 装置IDエラー
    'Public Const GENCT_NO_COM As String = "20"          ' 装置通信エラー
    'Public Const GENCT_NOT_ALLOW As String = "21"       ' 装置受付不可
    'Public Const GENCT_NOT_SAME As String = "22"        ' 装置プログラム名エラー
    'Public Const GENCT_SYS_ERROR As String = "99"       ' システムエラー

    'Public Const GENCT_STAT_OFF As String = "0"         ' インタロックOFF中
    'Public Const GENCT_STAT_ON As String = "1"          ' インタロックON中
    'Public Const GENCT_STAT_NON As String = "2"         ' 不定(立上り時インタロックOFF)
    'Public Const GENCT_STAT_ILNON As String = "3"       ' 処理OK(インタロック未対応F)
    'Public Const GENCT_STAT_BUSY As String = "9"        ' プログラム切替中待ち
    ''Ver4.1.5 インタロックステータス追加
    'Public Const GENCT_IL_OFF As Integer = 0            ' インタロックOFF中
    'Public Const GENCT_IL_ON As Integer = 1             ' インタロックON中
    'Public Const GENCT_IL_NON As Integer = 2            ' インタロック不定
    'Public Const GENCT_IL_NOUSE As Integer = 3          ' インタロック未使用

    ''装置タイプ
    'Public Const EQUIP_TYPE_KS As Integer = 0
    'Public Const EQUIP_TYPE_UTC As Integer = 1
    'Public Const EQUIP_TYPE_TOWA_YPS As Integer = 2
    'Public Const EQUIP_TYPE_TOWA_YPM As Integer = 3
    'Public Const EQUIP_TYPE_MEDEC As Integer = 4
    'Public Const EQUIP_TYPE_ASM_DB As Integer = 5
    'Public Const EQUIP_TYPE_DISCO As Integer = 6
    'Public Const EQUIP_TYPE_BESTEM As Integer = 7
    ''Ver4.3.0
    'Public Const EQUIP_TYPE_FCM As Integer = 8
    ''Ver4.4.2
    'Public Const EQUIP_TYPE_ASM_898 As Integer = 9
    'Public Const EQUIP_TYPE_ASM_HARR As Integer = 10
    'Public Const EQUIP_TYPE_ASM_IDEAL As Integer = 11
    ''Ver4.4.6
    'Public Const EQUIP_TYPE_OE7xxx As Integer = 12
    'Public Const EQUIP_TYPE_ASAHI As Integer = 13
    'Public Const EQUIP_TYPE_TSK_AWD As Integer = 14
    'Public Const EQUIP_TYPE_UF_FAD As Integer = 15
    ''Ver4.5.2
    'Public Const EQUIP_TYPE_MECO As Integer = 16

    'Public Const EQUIP_TYPE_MAX As Integer = 17

    'Public g_szEquipTypeInfo(EQUIP_TYPE_MAX) As String

    'Public Structure EquipTypeTYPE
    '    Dim szFromIPaddr As String
    '    Dim iFromIPaddr() As Integer
    '    Dim szToIPaddr As String
    '    Dim iToIPaddr() As Integer
    '    Dim iType As Integer
    '    'Ver4.2.2 DeviceID Add
    '    Dim iDeviceID As Integer
    '    'Splitter対応
    '    Dim szActIPaddr As String
    '    Dim iActIPaddr() As Integer
    '    Dim iActPortNo As Integer
    '    Dim iActIPuse As Integer

    '    Public Sub Initialize()
    '        ReDim iFromIPaddr(4)
    '        ReDim iToIPaddr(4)
    '        ReDim iActIPaddr(4)
    '    End Sub
    'End Structure
    'Public g_EquipType() As EquipTypeTYPE

    '>>20170909兪
    Public Enum SwapStatus
        NO_SWAP = 0
        TO_SWAP
        SWAPPING
    End Enum
    '<<20170909兪
End Module
